export function pipeFromArray(fns: Function[]) {
  if (fns.length == 0) {
    return (x: any) => x
  }
  if (fns.length === 1) {
    return fns[0]
  }
  return function piped(input: any) {
    // c(b(a()))
    return fns.reduce((prev: any, fn: Function) => fn(prev), input)
  }
}